package com.cngphone.AnFetion.tools;

import android.util.Log;
/**
 * a wrapper of android.util.Log
 * 
 * 
 * @author bangbang.song@gmail.con 2009091107
 *
 */
public class LogUtil {
	private static String sSystemNane = "you MUST init me ^_^";
	
	private static final int LEVEL_V = 5;
	private static final int LEVEL_W = 4;
	private static final int LEVEL_I = 3;
	private static final int LEVEL_D = 2;
	private static final int LEVLE_E = 1;
	private static final int LEVEL_NONE = 0; // no log
	
	public static void initSysName(String name) {
		sSystemNane = name;
	}
	
	public static void v(String tag, String msg) {
		Log.v(composeTag(sSystemNane, tag), msg);
	}
	
	public static void w(String tag, String msg) {
		Log.w(composeTag(sSystemNane, tag), msg);
	}
	
	public static void i(String tag, String msg) {
		Log.i(composeTag(sSystemNane, tag), msg);
	}
	
	public static void d(String tag, String msg) {
		Log.d(composeTag(sSystemNane, tag), msg);
	}
	
	public static void e(String tag, String msg) {
		Log.e(composeTag(sSystemNane, tag), msg);
	}
	
	private static String composeTag(String sysName, String tag) {
		return sysName + ":" + tag;
	}
}
